﻿using System;
using System.Globalization;
using System.Windows.Data;
using System.Windows.Media;
using ProjectBilling.Application;

namespace ProjectBilling.UI.SL
{
    public class StatusToBrushConverter 
        : IValueConverter
    {

        public object Convert(object value, Type targetType, 
            object parameter, CultureInfo culture)
        {
            Status status = (Status)value;
            switch (status)
            {
                case Status.Good:
                    return new SolidColorBrush(Colors.Green);
                case Status.Bad:
                    return new SolidColorBrush(Colors.Red);
            }
            return new SolidColorBrush(Colors.Black);
        }

        public object ConvertBack(object value, Type targetType,
            object parameter, CultureInfo culture)
        {
            throw new System.NotImplementedException();
        }
    }
}
